
/**
 * 文件上传模块，可以在内部使用任意的样式
 * */
class UploadFile extends React.Component {

    addFile = () => {
        this.refs.input.click()
    };

    render() {
        const {children, multiple, accept, onChange, className} = this.props;
        return (<div className={className} onClick={this.addFile}>
            <InputFile ref="input" multiple={multiple} accept={accept} onChange={onChange}/>
            {children}
        </div>);
    }
}

UploadFile.propTypes = {
    accept: PropTypes.string,
    children: PropTypes.any,
    className: PropTypes.string,
    disabled: PropTypes.bool,
    multiple: PropTypes.bool,
    onChange: PropTypes.func
};